home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / Resources.a < prev    next >
Encoding:
Text File  |  1997-08-12  |  16.8 KB  |  623 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Resources.a
  3. ;
  4. ;    Contains:    Resource Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.0.1
  8. ;
  9. ;    Copyright:    © 1985-1997 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__RESOURCES__') = 'UNDEFINED' THEN
  19. __RESOURCES__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  25.     include 'MixedMode.a'
  26.     ENDIF
  27.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  28.     include 'Files.a'
  29.     ENDIF
  30.  
  31.  
  32. resSysHeap                        EQU        64                    ;System or application heap?
  33. resPurgeable                    EQU        32                    ;Purgeable resource?
  34. resLocked                        EQU        16                    ;Load it in locked?
  35. resProtected                    EQU        8                    ;Protected?
  36. resPreload                        EQU        4                    ;Load in on OpenResFile?
  37. resChanged                        EQU        2                    ;Resource changed?
  38. mapReadOnly                        EQU        128                    ;Resource file read-only
  39. mapCompact                        EQU        64                    ;Compact resource file
  40. mapChanged                        EQU        32                    ;Write map out at update
  41.  
  42. resSysRefBit                    EQU        7                    ;reference to system/local reference
  43. resSysHeapBit                    EQU        6                    ;In system/in application heap
  44. resPurgeableBit                    EQU        5                    ;Purgeable/not purgeable
  45. resLockedBit                    EQU        4                    ;Locked/not locked
  46. resProtectedBit                    EQU        3                    ;Protected/not protected
  47. resPreloadBit                    EQU        2                    ;Read in at OpenResource?
  48. resChangedBit                    EQU        1                    ;Existing resource changed since last update
  49. mapReadOnlyBit                    EQU        7                    ;is this file read-only?
  50. mapCompactBit                    EQU        6                    ;Is a compact necessary?
  51. mapChangedBit                    EQU        5                    ;Is it necessary to write map?
  52.  
  53. kResFileNotOpened                EQU        -1                    ;ref num return as error when opening a resource file
  54. kSystemResFile                    EQU        0                    ;this is the default ref num to the system file
  55.  
  56. ;
  57. ; pascal short InitResources(void )
  58. ;
  59.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  60.         _InitResources:    OPWORD    $A995
  61.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  62.         IMPORT_CFM_FUNCTION InitResources
  63.     ENDIF
  64.  
  65. ;
  66. ; pascal void RsrcZoneInit(void )
  67. ;
  68.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  69.         _RsrcZoneInit:    OPWORD    $A996
  70.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  71.         IMPORT_CFM_FUNCTION RsrcZoneInit
  72.     ENDIF
  73.  
  74. ;
  75. ; pascal void CloseResFile(short refNum)
  76. ;
  77.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  78.         _CloseResFile:    OPWORD    $A99A
  79.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  80.         IMPORT_CFM_FUNCTION CloseResFile
  81.     ENDIF
  82.  
  83. ;
  84. ; pascal OSErr ResError(void )
  85. ;
  86.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  87.         _ResError:    OPWORD    $A9AF
  88.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  89.         IMPORT_CFM_FUNCTION ResError
  90.     ENDIF
  91.  
  92. ;
  93. ; pascal short CurResFile(void )
  94. ;
  95.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  96.         _CurResFile:    OPWORD    $A994
  97.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  98.         IMPORT_CFM_FUNCTION CurResFile
  99.     ENDIF
  100.  
  101. ;
  102. ; pascal short HomeResFile(Handle theResource)
  103. ;
  104.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  105.         _HomeResFile:    OPWORD    $A9A4
  106.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  107.         IMPORT_CFM_FUNCTION HomeResFile
  108.     ENDIF
  109.  
  110. ;
  111. ; pascal void CreateResFile(ConstStr255Param fileName)
  112. ;
  113.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  114.         _CreateResFile:    OPWORD    $A9B1
  115.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  116.         IMPORT_CFM_FUNCTION CreateResFile
  117.     ENDIF
  118.  
  119. ;
  120. ; pascal short OpenResFile(ConstStr255Param fileName)
  121. ;
  122.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  123.         _OpenResFile:    OPWORD    $A997
  124.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  125.         IMPORT_CFM_FUNCTION OpenResFile
  126.     ENDIF
  127.  
  128. ;
  129. ; pascal void UseResFile(short refNum)
  130. ;
  131.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  132.         _UseResFile:    OPWORD    $A998
  133.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  134.         IMPORT_CFM_FUNCTION UseResFile
  135.     ENDIF
  136.  
  137. ;
  138. ; pascal short CountTypes(void )
  139. ;
  140.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  141.         _CountTypes:    OPWORD    $A99E
  142.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  143.         IMPORT_CFM_FUNCTION CountTypes
  144.     ENDIF
  145.  
  146. ;
  147. ; pascal short Count1Types(void )
  148. ;
  149.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  150.         _Count1Types:    OPWORD    $A81C
  151.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  152.         IMPORT_CFM_FUNCTION Count1Types
  153.     ENDIF
  154.  
  155. ;
  156. ; pascal void GetIndType(ResType *theType, short index)
  157. ;
  158.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  159.         _GetIndType:    OPWORD    $A99F
  160.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  161.         IMPORT_CFM_FUNCTION GetIndType
  162.     ENDIF
  163.  
  164. ;
  165. ; pascal void Get1IndType(ResType *theType, short index)
  166. ;
  167.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  168.         _Get1IndType:    OPWORD    $A80F
  169.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  170.         IMPORT_CFM_FUNCTION Get1IndType
  171.     ENDIF
  172.  
  173. ;
  174. ; pascal void SetResLoad(Boolean load)
  175. ;
  176.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  177.         _SetResLoad:    OPWORD    $A99B
  178.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  179.         IMPORT_CFM_FUNCTION SetResLoad
  180.     ENDIF
  181.  
  182. ;
  183. ; pascal short CountResources(ResType theType)
  184. ;
  185.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  186.         _CountResources:    OPWORD    $A99C
  187.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  188.         IMPORT_CFM_FUNCTION CountResources
  189.     ENDIF
  190.  
  191. ;
  192. ; pascal short Count1Resources(ResType theType)
  193. ;
  194.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  195.         _Count1Resources:    OPWORD    $A80D
  196.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  197.         IMPORT_CFM_FUNCTION Count1Resources
  198.     ENDIF
  199.  
  200. ;
  201. ; pascal Handle GetIndResource(ResType theType, short index)
  202. ;
  203.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  204.         _GetIndResource:    OPWORD    $A99D
  205.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  206.         IMPORT_CFM_FUNCTION GetIndResource
  207.     ENDIF
  208.  
  209. ;
  210. ; pascal Handle Get1IndResource(ResType theType, short index)
  211. ;
  212.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  213.         _Get1IndResource:    OPWORD    $A80E
  214.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  215.         IMPORT_CFM_FUNCTION Get1IndResource
  216.     ENDIF
  217.  
  218. ;
  219. ; pascal Handle GetResource(ResType theType, short theID)
  220. ;
  221.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  222.         _GetResource:    OPWORD    $A9A0
  223.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  224.         IMPORT_CFM_FUNCTION GetResource
  225.     ENDIF
  226.  
  227. ;
  228. ; pascal Handle Get1Resource(ResType theType, short theID)
  229. ;
  230.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  231.         _Get1Resource:    OPWORD    $A81F
  232.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  233.         IMPORT_CFM_FUNCTION Get1Resource
  234.     ENDIF
  235.  
  236. ;
  237. ; pascal Handle GetNamedResource(ResType theType, ConstStr255Param name)
  238. ;
  239.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  240.         _GetNamedResource:    OPWORD    $A9A1
  241.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  242.         IMPORT_CFM_FUNCTION GetNamedResource
  243.     ENDIF
  244.  
  245. ;
  246. ; pascal Handle Get1NamedResource(ResType theType, ConstStr255Param name)
  247. ;
  248.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  249.         _Get1NamedResource:    OPWORD    $A820
  250.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  251.         IMPORT_CFM_FUNCTION Get1NamedResource
  252.     ENDIF
  253.  
  254. ;
  255. ; pascal void LoadResource(Handle theResource)
  256. ;
  257.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  258.         _LoadResource:    OPWORD    $A9A2
  259.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  260.         IMPORT_CFM_FUNCTION LoadResource
  261.     ENDIF
  262.  
  263. ;
  264. ; pascal void ReleaseResource(Handle theResource)
  265. ;
  266.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  267.         _ReleaseResource:    OPWORD    $A9A3
  268.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  269.         IMPORT_CFM_FUNCTION ReleaseResource
  270.     ENDIF
  271.  
  272. ;
  273. ; pascal void DetachResource(Handle theResource)
  274. ;
  275.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  276.         _DetachResource:    OPWORD    $A992
  277.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  278.         IMPORT_CFM_FUNCTION DetachResource
  279.     ENDIF
  280.  
  281. ;
  282. ; pascal short UniqueID(ResType theType)
  283. ;
  284.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  285.         _UniqueID:    OPWORD    $A9C1
  286.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  287.         IMPORT_CFM_FUNCTION UniqueID
  288.     ENDIF
  289.  
  290. ;
  291. ; pascal short Unique1ID(ResType theType)
  292. ;
  293.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  294.         _Unique1ID:    OPWORD    $A810
  295.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  296.         IMPORT_CFM_FUNCTION Unique1ID
  297.     ENDIF
  298.  
  299. ;
  300. ; pascal short GetResAttrs(Handle theResource)
  301. ;
  302.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  303.         _GetResAttrs:    OPWORD    $A9A6
  304.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  305.         IMPORT_CFM_FUNCTION GetResAttrs
  306.     ENDIF
  307.  
  308. ;
  309. ; pascal void GetResInfo(Handle theResource, short *theID, ResType *theType, Str255 name)
  310. ;
  311.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  312.         _GetResInfo:    OPWORD    $A9A8
  313.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  314.         IMPORT_CFM_FUNCTION GetResInfo
  315.     ENDIF
  316.  
  317. ;
  318. ; pascal void SetResInfo(Handle theResource, short theID, ConstStr255Param name)
  319. ;
  320.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  321.         _SetResInfo:    OPWORD    $A9A9
  322.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  323.         IMPORT_CFM_FUNCTION SetResInfo
  324.     ENDIF
  325.  
  326. ;
  327. ; pascal void AddResource(Handle theData, ResType theType, short theID, ConstStr255Param name)
  328. ;
  329.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  330.         _AddResource:    OPWORD    $A9AB
  331.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  332.         IMPORT_CFM_FUNCTION AddResource
  333.     ENDIF
  334.  
  335. ;
  336. ; pascal long GetResourceSizeOnDisk(Handle theResource)
  337. ;
  338.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  339.         _GetResourceSizeOnDisk:    OPWORD    $A9A5
  340.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  341.         IMPORT_CFM_FUNCTION GetResourceSizeOnDisk
  342.     ENDIF
  343.  
  344. ;
  345. ; pascal long GetMaxResourceSize(Handle theResource)
  346. ;
  347.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  348.         _GetMaxResourceSize:    OPWORD    $A821
  349.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  350.         IMPORT_CFM_FUNCTION GetMaxResourceSize
  351.     ENDIF
  352.  
  353. ;
  354. ; pascal long RsrcMapEntry(Handle theResource)
  355. ;
  356.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  357.         _RsrcMapEntry:    OPWORD    $A9C5
  358.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  359.         IMPORT_CFM_FUNCTION RsrcMapEntry
  360.     ENDIF
  361.  
  362. ;
  363. ; pascal void SetResAttrs(Handle theResource, short attrs)
  364. ;
  365.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  366.         _SetResAttrs:    OPWORD    $A9A7
  367.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  368.         IMPORT_CFM_FUNCTION SetResAttrs
  369.     ENDIF
  370.  
  371. ;
  372. ; pascal void ChangedResource(Handle theResource)
  373. ;
  374.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  375.         _ChangedResource:    OPWORD    $A9AA
  376.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  377.         IMPORT_CFM_FUNCTION ChangedResource
  378.     ENDIF
  379.  
  380. ;
  381. ; pascal void RemoveResource(Handle theResource)
  382. ;
  383.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  384.         _RemoveResource:    OPWORD    $A9AD
  385.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  386.         IMPORT_CFM_FUNCTION RemoveResource
  387.     ENDIF
  388.  
  389. ;
  390. ; pascal void UpdateResFile(short refNum)
  391. ;
  392.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  393.         _UpdateResFile:    OPWORD    $A999
  394.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  395.         IMPORT_CFM_FUNCTION UpdateResFile
  396.     ENDIF
  397.  
  398. ;
  399. ; pascal void WriteResource(Handle theResource)
  400. ;
  401.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  402.         _WriteResource:    OPWORD    $A9B0
  403.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  404.         IMPORT_CFM_FUNCTION WriteResource
  405.     ENDIF
  406.  
  407. ;
  408. ; pascal void SetResPurge(Boolean install)
  409. ;
  410.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  411.         _SetResPurge:    OPWORD    $A993
  412.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  413.         IMPORT_CFM_FUNCTION SetResPurge
  414.     ENDIF
  415.  
  416. ;
  417. ; pascal short GetResFileAttrs(short refNum)
  418. ;
  419.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  420.         _GetResFileAttrs:    OPWORD    $A9F6
  421.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  422.         IMPORT_CFM_FUNCTION GetResFileAttrs
  423.     ENDIF
  424.  
  425. ;
  426. ; pascal void SetResFileAttrs(short refNum, short attrs)
  427. ;
  428.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  429.         _SetResFileAttrs:    OPWORD    $A9F7
  430.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  431.         IMPORT_CFM_FUNCTION SetResFileAttrs
  432.     ENDIF
  433.  
  434. ;
  435. ; pascal short OpenRFPerm(ConstStr255Param fileName, short vRefNum, SInt8 permission)
  436. ;
  437.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  438.         _OpenRFPerm:    OPWORD    $A9C4
  439.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  440.         IMPORT_CFM_FUNCTION OpenRFPerm
  441.     ENDIF
  442.  
  443. ;
  444. ; pascal Handle RGetResource(ResType theType, short theID)
  445. ;
  446.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  447.         _RGetResource:    OPWORD    $A80C
  448.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  449.         IMPORT_CFM_FUNCTION RGetResource
  450.     ENDIF
  451.  
  452. ;    Note:     The HOpenResFile trap was not implemented until System 7.  If you want to call HOpenResFile
  453. ;            while running on System 6 machines, then define USE_HOPENRESFILE_GLUE and link with
  454. ;            Interface.o which contains glue to implement HOpenResFile on pre-System 7 machines.
  455. ;
  456.  
  457.     IF &TYPE('USE_HOPENRESFILE_GLUE') <> 'UNDEFINED' THEN
  458. ;
  459. ; pascal short HOpenResFile(short vRefNum, long dirID, ConstStr255Param fileName, SInt8 permission)
  460. ;
  461.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  462.         IMPORT_CFM_FUNCTION HOpenResFile
  463.     ENDIF
  464.  
  465.     ELSE
  466. ;
  467. ; pascal short HOpenResFile(short vRefNum, long dirID, ConstStr255Param fileName, SInt8 permission)
  468. ;
  469.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  470.         _HOpenResFile:    OPWORD    $A81A
  471.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  472.         IMPORT_CFM_FUNCTION HOpenResFile
  473.     ENDIF
  474.  
  475.     ENDIF
  476. ;    Note:     The HCreateResFile trap was not implemented until System 7.  If you want to call HCreateResFile
  477. ;            while running on System 6 machines, then define USE_HCREATERESFILE_GLUE and link with
  478. ;            Interface.o which contains glue to implement HCreateResFile on pre-System 7 machines.
  479. ;
  480.  
  481.     IF &TYPE('USE_HCREATERESFILE_GLUE') <> 'UNDEFINED' THEN
  482. ;
  483. ; pascal void HCreateResFile(short vRefNum, long dirID, ConstStr255Param fileName)
  484. ;
  485.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  486.         IMPORT_CFM_FUNCTION HCreateResFile
  487.     ENDIF
  488.  
  489.     ELSE
  490. ;
  491. ; pascal void HCreateResFile(short vRefNum, long dirID, ConstStr255Param fileName)
  492. ;
  493.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  494.         _HCreateResFile:    OPWORD    $A81B
  495.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  496.         IMPORT_CFM_FUNCTION HCreateResFile
  497.     ENDIF
  498.  
  499.     ENDIF
  500. ;
  501. ; pascal short FSpOpenResFile(const FSSpec *spec, SignedByte permission)
  502. ;
  503.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  504.         Macro
  505.         _FSpOpenResFile
  506.             moveq               #13,D0
  507.             dc.w                $AA52
  508.         EndM
  509.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  510.         IMPORT_CFM_FUNCTION FSpOpenResFile
  511.     ENDIF
  512.  
  513. ;
  514. ; pascal void FSpCreateResFile(const FSSpec *spec, OSType creator, OSType fileType, ScriptCode scriptTag)
  515. ;
  516.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  517.         Macro
  518.         _FSpCreateResFile
  519.             moveq               #14,D0
  520.             dc.w                $AA52
  521.         EndM
  522.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  523.         IMPORT_CFM_FUNCTION FSpCreateResFile
  524.     ENDIF
  525.  
  526. ;
  527. ; pascal void ReadPartialResource(Handle theResource, long offset, void *buffer, long count)
  528. ;
  529.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  530.         Macro
  531.         _ReadPartialResource
  532.             moveq               #1,D0
  533.             dc.w                $A822
  534.         EndM
  535.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  536.         IMPORT_CFM_FUNCTION ReadPartialResource
  537.     ENDIF
  538.  
  539. ;
  540. ; pascal void WritePartialResource(Handle theResource, long offset, const void *buffer, long count)
  541. ;
  542.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  543.         Macro
  544.         _WritePartialResource
  545.             moveq               #2,D0
  546.             dc.w                $A822
  547.         EndM
  548.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  549.         IMPORT_CFM_FUNCTION WritePartialResource
  550.     ENDIF
  551.  
  552. ;
  553. ; pascal void SetResourceSize(Handle theResource, long newSize)
  554. ;
  555.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  556.         Macro
  557.         _SetResourceSize
  558.             moveq               #3,D0
  559.             dc.w                $A822
  560.         EndM
  561.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  562.         IMPORT_CFM_FUNCTION SetResourceSize
  563.     ENDIF
  564.  
  565. ;
  566. ; pascal Handle GetNextFOND(Handle fondHandle)
  567. ;
  568.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  569.         Macro
  570.         _GetNextFOND
  571.             moveq               #10,D0
  572.             dc.w                $A822
  573.         EndM
  574.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  575.         IMPORT_CFM_FUNCTION GetNextFOND
  576.     ENDIF
  577.  
  578. ;  Use TempInsertROMMap to force the ROM resource map to be
  579. ;   inserted into the chain in front of the system. Note that
  580. ;   this call is only temporary - the modified resource chain
  581. ;   is only used for the next call to the resource manager.
  582. ;   See IM IV 19 for more information. 
  583. ;
  584.  
  585. ;
  586. ; pascal void TempInsertROMMap(Boolean tempResLoad)
  587. ;
  588.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  589.         Macro
  590.         _TempInsertROMMap
  591.             moveq               #-1,D0
  592.             dc.w                $4A1F
  593.             dc.w                $56C0
  594.             dc.w                $31C0
  595.             dc.w                $0B9E
  596.         EndM
  597.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  598.         IMPORT_CFM_FUNCTION TempInsertROMMap
  599.     ENDIF
  600.  
  601.  
  602.     IF OLDROUTINENAMES THEN
  603.  
  604.     ENDIF    ; OLDROUTINENAMES
  605. ;    These typedefs were originally created for the Copland Resource Mangager
  606. ;
  607.  
  608. ; typedef short                         ResFileRefNum
  609.  
  610. ; typedef short                         ResID
  611.  
  612. ; typedef short                         ResAttributes
  613.  
  614. ; typedef short                         ResFileAttributes
  615.  
  616.  
  617.  
  618.     ENDIF ; __RESOURCES__ 
  619.  
  620.